package com.adcc.ags.gms.mq.vo;

import com.adcc.ags.gms.core.entity.BaseEntity;
import com.adcc.ags.gms.core.vo.BaseVO;
import com.adcc.ags.gms.mq.entity.Channel;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.Date;

/**
 * Created by zhangdawei on 2016/8/16.
 */
public class ChannelVO extends BaseVO{
    // 通道ID
    private long id;

    // 通道名称
    private String name;

    private String typeName;

    // 通道用户
    private String userId;

    private String create_time;

    private String effect;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getCreate_time() {
        return create_time;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getEffect() {
        return effect;
    }

    public void setEffect(String effect) {
        this.effect = effect;
    }

    @Override
    public Channel toEntity() {
        Channel channel = new Channel();
        channel.setId(this.id);
        channel.setName(this.name);
        channel.setUserId(this.userId);
        channel.setEffect(this.effect);
        return channel;
    }

    @Override
    public String toJson() throws JsonProcessingException {
        return new ObjectMapper().writeValueAsString(this);
    }


}
